package us.gaaoc.framework.webapp.phaselisteners;

import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
import java.util.Timer;

import us.gaaoc.framework.webapp.util.TimeoutTask;

public class TimeoutPhaseListener implements PhaseListener  {
	
	/** Generated Serial Version UID */
	private static final long serialVersionUID = 6876734112781545496L;
	
	public TimeoutPhaseListener() {
	}

	public void beforePhase(PhaseEvent phaseEvent) {
	}

	public void afterPhase(PhaseEvent phaseEvent) {		
		Timer timer = new Timer (  ) ; 
             TimeoutTask timerTask = new TimeoutTask();
		timer.schedule ( timerTask , 5*1000 ) ; 
		timer.cancel();
				
	}
	public PhaseId getPhaseId() {
		return PhaseId.RESTORE_VIEW;
	}
}

